package org.example.controller;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.example.pojo.Good;
import org.example.pojo.Result;
import org.example.service.GoodService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpHeaders;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/good")
@Tag(name = "商品管理", description = "商品管理")
public class GoodController {

    @Autowired
    private GoodService goodService;

    @PostMapping("good")
    @Operation(summary = "添加商品", description = "添加商品")
    public Result good(@RequestBody Good good){
        return goodService.add(good);
    }
}
